﻿
namespace BEGDC.PreContract.DAL
{
    using System;
    using System.Collections.Generic;
    using Castle.ActiveRecord;
    using NHibernate.Expression;


    [ActiveRecord]
    public partial class Role : ActiveRecordBase<Role>
    {
		#region Const Definition
		
		public const string CONST_RoleID								= "RoleID";
		public const string CONST_RoleName								= "RoleName";
		public const string CONST_Description							= "Description";

		#endregion
		
        #region Member Variables
        // Primary Key
        private System.Int32 _roleID;
        
        // Non Key
        private System.String _roleName;
        private System.String _description;

        // Parents
        
        
		

        #endregion

        public Role() {
               
        }
        public Role(
            System.String roleName
            ,System.String description) : this() {
                
            this._roleName = roleName; 
            this._description = description; 
        }
        
        #region Properties
        // Primary Key        
		
		#if (SQLServer)
        [PrimaryKey]
		#else
		[PrimaryKey(PrimaryKeyType.Native, SequenceName = "SEQ_ROLE_ROLEID")]
		#endif
        public System.Int32 RoleID {
            get { return this._roleID; }
            set {  this._roleID = value; }
        }
        
        // Non Key
        [Property]
        public System.String RoleName {
            get { return this._roleName; }
			set { if (value == null) return; if (value.Length > 20) this._roleName = value.Substring(0,20); else this._roleName = value; }	
        }
        
        [Property]
        public System.String Description {
            get { return this._description; }
			set { if (value == null) return; if (value.Length > 100) this._description = value.Substring(0,100); else this._description = value; }	
        }
        
        
        // Parent Relationships
        // Child Relationships
        
		
        #endregion
		
		// Clone
		public Role Clone()
		{
			Role newRole = new Role();
			
            newRole.RoleName = this._roleName; 
            newRole.Description = this._description; 
			return newRole;
		}
    }
}



